package PracticeFour;

import java.io.*;

public class PracticeFour {
    public static void main(String[] args) throws Exception {
        File file = new File("H:" + File.separator + "muyan" + File.separator + "vip" +
                File.separator + "yootk.txt");
        // 文件存在
        if (file.exists()) {
            // 对象实例化
            try (Reader reader = new FileReader(file)) {
                // 开辟字符数组
                char data[] = new char[1024];
                // 读取数据，随后返回读取到的数据长度
                int len = reader.read(data);
                System.out.println(new String(data, 0, len));
                // 字符数组转为字符串
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}